/**
 * 检测数据类型
 * @param {*} obj
 */

const typeCheck = obj => {
    const toString = Object.prototype.toString;
    const map = {
        "[object Boolean]": "boolean",
        "[object Number]": "number",
        "[object String]": "string",
        "[object Function]": "function",
        "[object Array]": "array",
        "[object Date]": "date",
        "[object RegExp]": "regExp",
        "[object Undefined]": "undefined",
        "[object Null]": "null",
        "[object Object]": "object",
        "[object Symbol]": "symbol",
        "[object BigInt]": "bigint",
    };

    return map[toString.call(obj)];
};

export default typeCheck;
